package com.ssy.lingxi.product.repository;

import com.ssy.lingxi.product.entity.OftenBuyCommodity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 常购商品清单持久化层
 * @author jw.chen
 * @version 2.0.0
 * @date 2021/10/19
 */
public interface OftenBuyCommodityRepository extends JpaRepository<OftenBuyCommodity,Long>, JpaSpecificationExecutor<OftenBuyCommodity> {
    Page<OftenBuyCommodity> findByShopIdAndMemberIdAndMemberRoleId(Long shopId, Long memberId, Long memberRoleId, Pageable page);

    List<OftenBuyCommodity> findByShopIdAndMemberIdAndMemberRoleIdAndCommoditySkuIdIn(Long shopId, Long memberId, Long memberRoleId, List<Long> commoditySkuIdList);

}
